package com.vast.admin.service;

import com.vast.admin.api.BestsignOpenApi;
import com.vast.admin.api.entity.SetPersonalCredential;
import com.vast.admin.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncService {

    @Autowired
    private CustomerService customerService;

    @Autowired
    private BestsignOpenApi bestsignOpenApi;


    /**
     * 设置上上签个人信息
     * @param customer
     */
    @Async
    public void setPersonalCredential(Customer customer) {
        SetPersonalCredential setPersonalCredential = new SetPersonalCredential();
        setPersonalCredential.setAccount(customer.getAccount());
        setPersonalCredential.setIdentity(customer.getIdentity());
        setPersonalCredential.setName(customer.getName());
        bestsignOpenApi.setPersonalCredential(setPersonalCredential);
        customerService.applyCert(customer.getWxId());
    }

}
